﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

namespace Htx.Fur.Database.Migrations.Migrations
{
    public partial class v100 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "Htx01",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Name = table.Column<int>(type: "int", nullable: false),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false),
                    CreatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: false),
                    UpdatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Htx01", x => x.Id);
                },
                comment: "测试表1");

            migrationBuilder.CreateTable(
                name: "UserInfo",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Name = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true, comment: "姓名"),
                    Code = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "编码"),
                    Age = table.Column<int>(type: "int", nullable: false, comment: "年龄"),
                    Address = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "地址")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_UserInfo", x => x.Id);
                },
                comment: "用户表");

            migrationBuilder.InsertData(
                table: "UserInfo",
                columns: new[] { "Id", "Address", "Age", "Code", "Name" },
                values: new object[] { 1, "湖北省孝感市汉川市", 33, "sunxiaoshuang", "孙小双" });

            migrationBuilder.InsertData(
                table: "UserInfo",
                columns: new[] { "Id", "Address", "Age", "Code", "Name" },
                values: new object[] { 2, "湖北省武汉市东湖高新区", 23, "huatianxiao", "华天晓" });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "Htx01");

            migrationBuilder.DropTable(
                name: "UserInfo");
        }
    }
}
